package com.itbupt.domain.order.adapter.repository;

import com.itbupt.domain.order.model.aggregate.CreateOrderAggregate;
import com.itbupt.domain.order.model.entity.OrderEntity;
import com.itbupt.domain.order.model.entity.PayOrderEntity;
import com.itbupt.domain.order.model.entity.ShopCartEntity;

import java.util.List;

/**
 * @Author dingchang
 * @Date 2025/5/10 0:37
 * @Description:
 */
public interface IOrderRepository {

    // 查询未支付的订单
    OrderEntity queryUnPayOrder(ShopCartEntity shopCartEntity);

    // 保存订单
    void doSaveOrder(CreateOrderAggregate orderAggregate);

    // 更新订单状态 - 创建成功，待支付-PAY_WAIT
    void updateOrderPayInfo(PayOrderEntity payOrderEntity);

    // 查询超时未支付订单
    List<String> queryNoPayNotifyOrder();

    // 更改订单状态 - 支付成功-PAY_SUCCESS
    void changeOrderPaySuccess(String orderId);

    // 查询超时未支付订单
    List<String> queryTimeoutCloseOrderList();

    // 关闭订单 - 状态为 close
    boolean changeOrderClose(String orderId);
}
